﻿namespace NJabber.Stream.Elements
{
    public class StanzaError : ErrorElement
    {
        public StanzaError(string errorType) : this(errorType, "")
        {}

        public StanzaError(string errorType, string errorName) : this(errorType, errorName, "", "")
        {}

        public StanzaError(string errorType, string errorName, string errorDescription, string descriptionLang) : base(XmppNamespaces.StanzaError)
        {
            ErrorType = errorType;
            ErrorName = errorName;
            ErrorDescription = errorDescription;
            DescriptionLang = descriptionLang;
        }

        public string ErrorType
        {
            get { return (string)GetAttributeValue("type"); }
            set { SetAttributeValue("type", value); }
        }

        public string ErrorGeneratorName
        {
            get { return (string)GetAttributeValue("by"); }
            set { SetAttributeValue("by", value); }
        }
    }
}
